<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWorkOrderProductCompanyTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('work_order_product_company', function (Blueprint $table) {
            $table->id();
            $table->string('goodsCode', 30)->default('')->comment('商品JED编码');
            $table->string('goodsName', 64)->default('')->comment('商品名称');
            $table->string('company', 64)->default('')->comment('厂家名称');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->index(['goodsCode'], 'idx_goodsCode');
            $table->comment = '工单 - 订货商品JDE code对应生产厂家映射表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('work_order_product_company');
    }
}
